package aash.catalog.views.panel;

import aash.catalog.views.component.AashComponent;
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.border.EtchedBorder;

/**
 * Property Panel for Explorer View.
 * @author Aashintan
 */
public class PropertyPanel extends AashPanel {
    /**
     * Default serial UID.
     */
    private static final long serialVersionUID = 207376622153836075L;
    /**
     * propertyPanel X position.
     */
    private final int posX = 100;
    /**
     * propertyPanel Y position.
     */
    private final int posY = 350;
    /**
     * propertyPanel width.
     */
    private final int width = 240;
    /**
     * propertyPanel height.
     */
    private final int height = 240;

    /**
     * Constant alpha = 0.99%.
     */
    /**
     * Class constructor.
     */
    public PropertyPanel() {
        super();
        setOpaque(true);
        setBackground(Color.GREEN);
        setBorder(new EtchedBorder(EtchedBorder.LOWERED));
        setBounds(posX, posY, width, height);
    }

    /**
     * Get the color of the component.
     * @return the Color
     */
    public final Color getColor() {
        return getBackground();
    }

    /**
     * Set the color of the component.
     * @param c color
     */
    public final void setColor(final Color c) {
        setBackground(c);
    }

    /**
     * Paint method.
     * @param g Graphics
     * @Override JComponent paint
     */
    public final void paint(final Graphics g) {
        Color c = Color.GREEN;
        g.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(),
            (int) (super.getAlpha() * AashComponent.RGB_RANGE)));
        g.fill3DRect(0, 0, width, height, true);
    }
}
